// 功法
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const ObjectId = Schema.Types.ObjectId;

const SkillSchema = new Schema({
    name: String, //技能名字
    info: { //介绍
        type: String,
        default: ""
    },
    type: { // 类型 1.被动技 2.主动技
        type: Number,
        require: true,
        default: 1
    },
    ad:{// 物理伤害附加
        type: Number,
        default: 0
    },
    ap:{// 法术伤害附加
        type: Number,
        default: 0
    },
    unit: { //技能作用单位数量
        type: Number,
        default: 1
    },
    attack_direction: { //技能目标
        type: Number,
        default: 2
    },
    buff:{// buff id
        type: ObjectId,
        ref: "buffs"
    },
    created_at: {
        type: Date,
        default: new Date()
    }
})

module.exports = Skills = mongoose.model("skills", SkillSchema);